package com.xiaoshuidi.cloud.module.contract.api.approval;

import com.xiaoshuidi.cloud.framework.common.pojo.CommonResult;
import com.xiaoshuidi.cloud.module.contract.api.ApprovalApi;
import com.xiaoshuidi.cloud.module.contract.dal.mysql.approval.ContractApprovalMapper;
import com.xiaoshuidi.cloud.module.contract.enums.ApproveTypeEnum;
import com.xiaoshuidi.cloud.module.contract.service.approval.ContractApprovalService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * OA 合同审批 Service 实现类
 *
 * @author red
 */
@RestController
@Validated
@RequiredArgsConstructor
@Slf4j
public class ApprovalImplApi implements ApprovalApi {
    @Resource
    private ContractApprovalMapper approvalMapper;

    @Resource
    private ContractApprovalService contractApprovalService;

    @Override
    public CommonResult<String> getApartmentMark(Long apartmentId,String status) {
        return CommonResult.success(contractApprovalService.getByRoomIdAndMark(apartmentId,status));
    }
//    @Override
//    public CommonResult<String> getApproval(Long apartmentId,String type) {
//        String mark = approvalMapper.getByRoomIdAndMark(apartmentId, type);
//        return CommonResult.success(mark);
//    }
}

